var dom = document.getElementById("container4");
var myChart = echarts.init(dom);
var app = {};

var option;



option = {
    title: {
        left: "center",
        verticalAlign:"bottom",
        textStyle: {
            fontSize: 13,
            lineHeight: 5,
			color:"white",
            align: "right",
            verticalAlign: "bottom"
        },
        show: true,
        text: "粉尘浓度"
    },
    series: [{
        center: [35,50],
        type: 'gauge',
        axisLine: {
            lineStyle: {
                width: 4,
                color: [
                    [0.3, '#67e0e3'],
                    [0.7, '#37a2da'],
                    [1, '#fd666d']
                ]
            }
        },
        pointer: {
            itemStyle: {
                color: 'auto'
            }
        },
        axisTick: {
            distance: -30,
            length: 8,
            lineStyle: {
                color: '#fff',
                width: 0
            }
        },
        splitLine: {
            distance: -30,
            length: 30,
            lineStyle: {
                color: '#fff',
                width: 0
            }
        },
        axisLabel: {
            color: 'auto',
            distance: 0,
            fontSize: 0
        },
        detail: {
            valueAnimation: true,
            formatter:'{value}mg/m3',
            color: 'auto',
            fontSize: 13,
            offsetCenter: [0,"100%"],
        },
        data: [{
            value: 70,
        }]
    }]
};

setInterval(function () {
    option.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
    myChart.setOption(option, true);
}, 2000);

if (option && typeof option === 'object') {
    myChart.setOption(option);
}